package com.ruoyi.userManage.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.userManage.mapper.UserBlindBoxConsumeRecordMapper;
import com.ruoyi.userManage.domain.UserBlindBoxConsumeRecord;
import com.ruoyi.userManage.service.IUserBlindBoxConsumeRecordService;

/**
 * 盲盒消费记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-12
 */
@Service
public class UserBlindBoxConsumeRecordServiceImpl implements IUserBlindBoxConsumeRecordService 
{
    @Autowired
    private UserBlindBoxConsumeRecordMapper userBlindBoxConsumeRecordMapper;

    /**
     * 查询盲盒消费记录
     * 
     * @param id 盲盒消费记录主键
     * @return 盲盒消费记录
     */
    @Override
    public UserBlindBoxConsumeRecord selectUserBlindBoxConsumeRecordById(Long id)
    {
        return userBlindBoxConsumeRecordMapper.selectUserBlindBoxConsumeRecordById(id);
    }

    /**
     * 查询盲盒消费记录列表
     * 
     * @param userBlindBoxConsumeRecord 盲盒消费记录
     * @return 盲盒消费记录
     */
    @Override
    public List<UserBlindBoxConsumeRecord> selectUserBlindBoxConsumeRecordList(UserBlindBoxConsumeRecord userBlindBoxConsumeRecord)
    {
        return userBlindBoxConsumeRecordMapper.selectUserBlindBoxConsumeRecordList(userBlindBoxConsumeRecord);
    }

    /**
     * 新增盲盒消费记录
     * 
     * @param userBlindBoxConsumeRecord 盲盒消费记录
     * @return 结果
     */
    @Override
    public int insertUserBlindBoxConsumeRecord(UserBlindBoxConsumeRecord userBlindBoxConsumeRecord)
    {
        userBlindBoxConsumeRecord.setCreateTime(DateUtils.getNowDate());
        return userBlindBoxConsumeRecordMapper.insertUserBlindBoxConsumeRecord(userBlindBoxConsumeRecord);
    }

    /**
     * 修改盲盒消费记录
     * 
     * @param userBlindBoxConsumeRecord 盲盒消费记录
     * @return 结果
     */
    @Override
    public int updateUserBlindBoxConsumeRecord(UserBlindBoxConsumeRecord userBlindBoxConsumeRecord)
    {
        userBlindBoxConsumeRecord.setUpdateTime(DateUtils.getNowDate());
        return userBlindBoxConsumeRecordMapper.updateUserBlindBoxConsumeRecord(userBlindBoxConsumeRecord);
    }

    /**
     * 批量删除盲盒消费记录
     * 
     * @param ids 需要删除的盲盒消费记录主键
     * @return 结果
     */
    @Override
    public int deleteUserBlindBoxConsumeRecordByIds(Long[] ids)
    {
        return userBlindBoxConsumeRecordMapper.deleteUserBlindBoxConsumeRecordByIds(ids);
    }

    /**
     * 删除盲盒消费记录信息
     * 
     * @param id 盲盒消费记录主键
     * @return 结果
     */
    @Override
    public int deleteUserBlindBoxConsumeRecordById(Long id)
    {
        return userBlindBoxConsumeRecordMapper.deleteUserBlindBoxConsumeRecordById(id);
    }
}
